Skip to content

Add Fable 5 support across Anthropic providers#555

Merged
navedmerchant merged 2 commits into
mainfrom
feat/add-fable
Jun 12, 2026
Merged

Add Fable 5 support across Anthropic providers#555
navedmerchant merged 2 commits into
mainfrom
feat/add-fable

Conversation

@taltas

@taltas taltas commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Claude Fable 5 model support across Anthropic-related provider type definitions and runtime handlers
  • update fetchers and model parameter handling for Fable 5 request behavior, including provider-specific temperature and reasoning handling
  • add and expand provider/fetcher/shared tests covering Anthropic, Vertex, Bedrock, Requesty, OpenRouter, and Vercel AI Gateway Fable 5 behavior

Testing

  • Prior implementation subtask reported the relevant provider tests passed before this review-prep workflow.
  • Updated regression coverage is included in the provider and transform test files in this branch.

Summary by CodeRabbit

  • New Features

    • Added support for Claude Fable 5 across Anthropic, Bedrock, OpenRouter, Vercel AI Gateway, and Vertex.
    • Enabled adaptive thinking / reasoning (budget & binary) and prompt-caching support where applicable.
    • Model-specific temperature handling: temperature is omitted when unsupported.
  • Tests

    • Added unit and integration tests covering Claude Fable 5 behavior and parsing across providers.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 469ad559-0e6b-46a2-873e-17b94ace14dc

📥 Commits

Reviewing files that changed from the base of the PR and between b4614ff and ea0ddd6.

📒 Files selected for processing (23)
  • packages/types/src/providers/anthropic.ts
  • packages/types/src/providers/bedrock.ts
  • packages/types/src/providers/openrouter.ts
  • packages/types/src/providers/vercel-ai-gateway.ts
  • packages/types/src/providers/vertex.ts
  • src/api/providers/__tests__/anthropic-vertex.spec.ts
  • src/api/providers/__tests__/anthropic.spec.ts
  • src/api/providers/__tests__/bedrock.spec.ts
  • src/api/providers/__tests__/requesty.spec.ts
  • src/api/providers/__tests__/vercel-ai-gateway.spec.ts
  • src/api/providers/anthropic.ts
  • src/api/providers/bedrock.ts
  • src/api/providers/fetchers/__tests__/openrouter.spec.ts
  • src/api/providers/fetchers/__tests__/requesty.spec.ts
  • src/api/providers/fetchers/__tests__/vercel-ai-gateway.spec.ts
  • src/api/providers/fetchers/openrouter.ts
  • src/api/providers/fetchers/requesty.ts
  • src/api/providers/fetchers/vercel-ai-gateway.ts
  • src/api/providers/requesty.ts
  • src/api/providers/vercel-ai-gateway.ts
  • src/api/transform/__tests__/model-params.spec.ts
  • src/api/transform/model-params.ts
  • src/shared/__tests__/api.spec.ts
🚧 Files skipped from review as they are similar to previous changes (19)
  • src/api/providers/anthropic.ts
  • packages/types/src/providers/vercel-ai-gateway.ts
  • src/api/providers/fetchers/tests/vercel-ai-gateway.spec.ts
  • src/api/transform/tests/model-params.spec.ts
  • src/api/providers/fetchers/openrouter.ts
  • src/api/providers/fetchers/tests/openrouter.spec.ts
  • packages/types/src/providers/vertex.ts
  • packages/types/src/providers/bedrock.ts
  • src/api/providers/vercel-ai-gateway.ts
  • src/api/providers/tests/anthropic.spec.ts
  • src/api/providers/tests/vercel-ai-gateway.spec.ts
  • src/api/providers/tests/requesty.spec.ts
  • src/api/providers/fetchers/vercel-ai-gateway.ts
  • src/api/providers/fetchers/requesty.ts
  • src/api/providers/tests/bedrock.spec.ts
  • src/shared/tests/api.spec.ts
  • packages/types/src/providers/anthropic.ts
  • src/api/providers/bedrock.ts
  • src/api/providers/requesty.ts

📝 Walkthrough

Walkthrough

This PR registers Claude Fable 5 across provider registries, adds capability overrides and temperature guards in fetchers and handlers, marks the model as adaptive-thinking where appropriate, enables prompt-caching for Anthropic, wires provider-specific reasoning parameters for Requesty, and adds tests across providers to validate behavior.

Changes

Claude Fable 5 Multi-Provider Support

Layer / File(s) Summary
Model Registry Definitions
packages/types/src/providers/anthropic.ts, packages/types/src/providers/bedrock.ts, packages/types/src/providers/openrouter.ts, packages/types/src/providers/vercel-ai-gateway.ts, packages/types/src/providers/vertex.ts
Registers claude-fable-5 / anthropic.claude-fable-5 / anthropic/claude-fable-5 in provider registries and allowlists with token limits, context windows, pricing rates (input/output and cache read/write), cachable fields, and capability flags (reasoning budget, reasoning binary, supportsTemperature).
Anthropic Handler Prompt Caching & Tests
src/api/providers/anthropic.ts, src/api/providers/__tests__/anthropic.spec.ts, src/api/providers/__tests__/anthropic-vertex.spec.ts
Adds claude-fable-5 to Anthropic prompt-caching and cache_control: ephemeral handling and includes tests asserting adaptive thinking, temperature omission, max token handling, and prompt-caching beta header.
Bedrock Adaptive Thinking & Tests
src/api/providers/bedrock.ts, src/api/providers/__tests__/bedrock.spec.ts
Extends Bedrock isAdaptiveThinkingModel to recognize fable-5, updates inline documentation, and adds tests for model info and cross-region/global prefix behavior.
Vercel Gateway Temperature Handling & Fetcher Overrides
src/api/providers/vercel-ai-gateway.ts, src/api/providers/fetchers/vercel-ai-gateway.ts, src/api/providers/__tests__/vercel-ai-gateway.spec.ts
Derives supportsTemperature from model info and handler capability checks to gate temperature in requests; fetcher override disables temperature for Fable 5 and tests verify omission.
OpenRouter Fetcher & Allowlist
src/api/providers/fetchers/openrouter.ts, packages/types/src/providers/openrouter.ts, src/api/providers/fetchers/__tests__/openrouter.spec.ts
Adds special-case parsing for anthropic/claude-fable-5 (overrides maxTokens, enables reasoning binary, disables temperature) and includes the model in OpenRouter prompt-caching/reasoning allowlists with tests.
Requesty Provider Reasoning Wiring & Tests
src/api/providers/requesty.ts, src/api/providers/fetchers/requesty.ts, src/api/providers/__tests__/requesty.spec.ts, src/api/providers/fetchers/__tests__/requesty.spec.ts
Switches Requesty to Anthropic provider-specific reasoning types/helpers, computes provider reasoning params for model assembly, applies Fable 5 capability overrides in fetchers, and adds tests verifying adaptive thinking and temperature omission.
OpenRouter Temperature Guard & Tests
src/api/transform/model-params.ts, src/api/transform/__tests__/model-params.spec.ts
Adds a generic OpenRouter supportsTemperature === false guard in getModelParams to unset temperature when the model reports no temperature support; tests confirm behavior.
Shared and Misc Test Coverage
src/shared/__tests__/api.spec.ts
Adds tests for Anthropic hybrid token handling and ensures model max output tokens are computed as expected with/without reasoning effort enabled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Zoo-Code-Org/Zoo-Code#386: Related work adding new Claude model IDs into prompt-caching and adaptive-thinking handling (similar provider wiring changes).

Suggested reviewers

  • navedmerchant
  • hannesrudolph
  • edelauna

Poem

🐰 A fable springs forth, Claude Fable 5 so bright,
Across providers stitched, each handler takes flight,
Cache-control and thinking, temp set to none,
Tests hop along, every check passes—done! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks required template sections: no GitHub issue link, no detailed implementation details beyond high-level summary, and no test procedure documentation. Add the related GitHub issue number under 'Closes:', include implementation details and design decisions, document specific test procedures, and complete the pre-submission checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main objective: adding Claude Fable 5 model support across multiple Anthropic provider integrations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-fable

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
packages/types/src/providers/bedrock.ts (2)

591-598: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add anthropic.claude-fable-5 to the 1M context model list.

The anthropic.claude-fable-5 model definition (line 222) declares contextWindow: 1_000_000, but the model ID is missing from the BEDROCK_1M_CONTEXT_MODEL_IDS constant. This constant gates extended context behavior (per the inline comment on line 172 referencing the beta flag), so the omission could prevent 1M context requests for Fable 5 on Bedrock.

🔧 Proposed fix
 export const BEDROCK_1M_CONTEXT_MODEL_IDS = [
 	"anthropic.claude-sonnet-4-20250514-v1:0",
 	"anthropic.claude-sonnet-4-5-20250929-v1:0",
 	"anthropic.claude-sonnet-4-6",
 	"anthropic.claude-opus-4-6-v1",
 	"anthropic.claude-opus-4-7",
 	"anthropic.claude-opus-4-8",
+	"anthropic.claude-fable-5",
 ] as const
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/types/src/providers/bedrock.ts` around lines 591 - 598, The
BEDROCK_1M_CONTEXT_MODEL_IDS constant is missing the Anthropic Fable 5 model ID,
so add "anthropic.claude-fable-5" to the BEDROCK_1M_CONTEXT_MODEL_IDS array to
match the model definition that sets contextWindow: 1_000_000 (see the model
definition for Fable 5). Update the array in the BEDROCK_1M_CONTEXT_MODEL_IDS
export to include that exact string so Fable 5 is treated as a 1M-context model
by the extended-context gating logic.

609-618: ⚠️ Potential issue | 🟡 Minor

Add anthropic.claude-fable-5 to global inference allowlist

AWS Bedrock’s Claude Fable 5 model card lists the Global inference ID as global.anthropic.claude-fable-5, but BEDROCK_GLOBAL_INFERENCE_MODEL_IDS currently omits anthropic.claude-fable-5, so when awsUseGlobalInference is enabled the provider won’t apply the global. prefix for this model. Add "anthropic.claude-fable-5" to packages/types/src/providers/bedrock.ts (lines ~609-618).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/types/src/providers/bedrock.ts` around lines 609 - 618,
BEDROCK_GLOBAL_INFERENCE_MODEL_IDS is missing the entry for Claude Fable 5, so
when awsUseGlobalInference is enabled the provider won't add the required
"global." prefix; fix it by adding "anthropic.claude-fable-5" to the
BEDROCK_GLOBAL_INFERENCE_MODEL_IDS const (the array exported in
packages/types/src/providers/bedrock.ts) so the global inference allowlist
includes that model ID.
packages/types/src/providers/vertex.ts (1)

645-652: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add claude-fable-5 to the 1M context model list.

The claude-fable-5 model definition (line 439) declares contextWindow: 1_000_000, but the model ID is missing from the VERTEX_1M_CONTEXT_MODEL_IDS constant. Per the comment on line 644, this constant gates the beta header 'context-1m-2025-08-07' for extended context. Omitting Fable 5 will prevent 1M context requests from working correctly on Vertex.

🔧 Proposed fix
 export const VERTEX_1M_CONTEXT_MODEL_IDS = [
 	"claude-sonnet-4@20250514",
 	"claude-sonnet-4-5@20250929",
 	"claude-sonnet-4-6",
 	"claude-opus-4-6",
 	"claude-opus-4-7",
 	"claude-opus-4-8",
+	"claude-fable-5",
 ] as const
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/types/src/providers/vertex.ts` around lines 645 - 652, The
VERTEX_1M_CONTEXT_MODEL_IDS constant is missing the "claude-fable-5" model ID
which prevents the 1M context beta header from being applied; update the
VERTEX_1M_CONTEXT_MODEL_IDS array to include "claude-fable-5" (alongside the
other entries) so that the model declared with contextWindow: 1_000_000 (the
claude-fable-5 definition) is correctly recognized for extended context
handling.
packages/types/src/providers/openrouter.ts (1)

72-91: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add anthropic/claude-fable-5 to the reasoning budget models list.

The claude-fable-5 model definition in anthropic.ts (lines 140-141) sets both supportsReasoningBudget: true and supportsReasoningBinary: true, matching the reasoning capabilities of models already in this set (e.g., anthropic/claude-opus-4.6, anthropic/claude-sonnet-4.6). Omitting Fable 5 from OPEN_ROUTER_REASONING_BUDGET_MODELS will prevent the UI from offering reasoning toggles for this model on the OpenRouter provider path.

🔧 Proposed fix
 export const OPEN_ROUTER_REASONING_BUDGET_MODELS = new Set([
 	"anthropic/claude-3.7-sonnet:beta",
 	"anthropic/claude-opus-4",
 	"anthropic/claude-opus-4.1",
 	"anthropic/claude-opus-4.5",
 	"anthropic/claude-opus-4.6",
+	"anthropic/claude-fable-5",
 	"anthropic/claude-sonnet-4",
 	"anthropic/claude-sonnet-4.5",
 	"anthropic/claude-sonnet-4.6",
 	"anthropic/claude-haiku-4.5",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/types/src/providers/openrouter.ts` around lines 72 - 91,
OPEN_ROUTER_REASONING_BUDGET_MODELS is missing the anthropic Fable 5 entry so
the UI won't surface reasoning toggles for that model; add
"anthropic/claude-fable-5" to the OPEN_ROUTER_REASONING_BUDGET_MODELS Set
(alongside existing entries like "anthropic/claude-opus-4.6") so the provider
path recognizes Fable 5's supportsReasoningBudget/supportsReasoningBinary
capabilities.
🧹 Nitpick comments (2)
src/api/providers/fetchers/__tests__/openrouter.spec.ts (1)

293-317: ⚡ Quick win

Expand test coverage to verify reasoning capabilities.

The test verifies maxTokens, contextWindow, and supportsTemperature, but doesn't assert supportsReasoningBudget or supportsReasoningBinary. The similar test for claude-3.7-sonnet (lines 19-48) includes assertions for reasoning capabilities. Whether these fields should be true, false, or undefined for claude-fable-5, the test should explicitly verify the expected behavior to ensure configuration correctness.

🧪 Suggested test expansion
 		expect(result.maxTokens).toBe(128000)
 		expect(result.contextWindow).toBe(1000000)
 		expect(result.supportsTemperature).toBe(false)
+		expect(result.supportsReasoningBudget).toBeDefined()
+		expect(result.supportsReasoningBinary).toBeDefined()
 	})

As per coding guidelines: use package-local unit tests for pure logic, parsing, state transitions, validation, serialization, request construction, retry decisions, and error handling.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api/providers/fetchers/__tests__/openrouter.spec.ts` around lines 293 -
317, The test for claude-fable-5 in openrouter.spec.ts omits assertions for
reasoning capability flags; update the test that calls parseOpenRouterModel (id:
"anthropic/claude-fable-5") to explicitly assert the expected values for
result.supportsReasoningBudget and result.supportsReasoningBinary (match the
expected behavior used in the claude-3.7-sonnet test), e.g., add
expect(result.supportsReasoningBudget).toBe(...) and
expect(result.supportsReasoningBinary).toBe(...) so the parsing logic for
reasoning capabilities is covered.

Source: Coding guidelines

src/api/transform/model-params.ts (1)

183-190: 💤 Low value

Update or remove the outdated TODO comment.

The TODO comment mentions adding a supportsTemperature field to model info and populating it in the OpenRouter fetcher, but this PR actually implements that functionality. The generic guard above (lines 179-181) now honors the supportsTemperature flag, and per the context snippet, the OpenRouter fetcher sets this flag for claude-fable-5.

Consider updating the comment to reflect that the field now exists but may need broader adoption across additional models, or remove it if the TODO is fully addressed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api/transform/model-params.ts` around lines 183 - 190, The TODO about
adding a supportsTemperature field is now outdated—update the comment or remove
it: either delete the TODO lines and the note about OpenRouter's
supported_parameters, or change the comment to note that supportsTemperature is
implemented (used by the generic guard above) and that OpenRouter fetcher
already sets it for models like "claude-fable-5"; locate the block handling
modelId === "openai/o1-pro" in model-params.ts and adjust the comment
accordingly so it accurately reflects the current supportsTemperature handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/types/src/providers/anthropic.ts`:
- Around line 129-145: The claude-fable-5 provider entry in
packages/types/src/providers/anthropic.ts currently sets maxTokens: 128_000
while the same model entries in packages/types/src/providers/bedrock.ts and
packages/types/src/providers/vertex.ts use 8192; update the claude-fable-5
declaration to either match 8192 or add explicit logic/documentation that the
128k value is only valid when the reasoning toggle is enabled (e.g., reference
the override comment about `enableReasoningEffort`), and ensure any enforcement
is centralized (same constant or helper) so token limits are consistent across
the "claude-fable-5" entries and any code that reads provider.maxTokens uses the
unified value or the documented conditional.

---

Outside diff comments:
In `@packages/types/src/providers/bedrock.ts`:
- Around line 591-598: The BEDROCK_1M_CONTEXT_MODEL_IDS constant is missing the
Anthropic Fable 5 model ID, so add "anthropic.claude-fable-5" to the
BEDROCK_1M_CONTEXT_MODEL_IDS array to match the model definition that sets
contextWindow: 1_000_000 (see the model definition for Fable 5). Update the
array in the BEDROCK_1M_CONTEXT_MODEL_IDS export to include that exact string so
Fable 5 is treated as a 1M-context model by the extended-context gating logic.
- Around line 609-618: BEDROCK_GLOBAL_INFERENCE_MODEL_IDS is missing the entry
for Claude Fable 5, so when awsUseGlobalInference is enabled the provider won't
add the required "global." prefix; fix it by adding "anthropic.claude-fable-5"
to the BEDROCK_GLOBAL_INFERENCE_MODEL_IDS const (the array exported in
packages/types/src/providers/bedrock.ts) so the global inference allowlist
includes that model ID.

In `@packages/types/src/providers/openrouter.ts`:
- Around line 72-91: OPEN_ROUTER_REASONING_BUDGET_MODELS is missing the
anthropic Fable 5 entry so the UI won't surface reasoning toggles for that
model; add "anthropic/claude-fable-5" to the OPEN_ROUTER_REASONING_BUDGET_MODELS
Set (alongside existing entries like "anthropic/claude-opus-4.6") so the
provider path recognizes Fable 5's
supportsReasoningBudget/supportsReasoningBinary capabilities.

In `@packages/types/src/providers/vertex.ts`:
- Around line 645-652: The VERTEX_1M_CONTEXT_MODEL_IDS constant is missing the
"claude-fable-5" model ID which prevents the 1M context beta header from being
applied; update the VERTEX_1M_CONTEXT_MODEL_IDS array to include
"claude-fable-5" (alongside the other entries) so that the model declared with
contextWindow: 1_000_000 (the claude-fable-5 definition) is correctly recognized
for extended context handling.

---

Nitpick comments:
In `@src/api/providers/fetchers/__tests__/openrouter.spec.ts`:
- Around line 293-317: The test for claude-fable-5 in openrouter.spec.ts omits
assertions for reasoning capability flags; update the test that calls
parseOpenRouterModel (id: "anthropic/claude-fable-5") to explicitly assert the
expected values for result.supportsReasoningBudget and
result.supportsReasoningBinary (match the expected behavior used in the
claude-3.7-sonnet test), e.g., add
expect(result.supportsReasoningBudget).toBe(...) and
expect(result.supportsReasoningBinary).toBe(...) so the parsing logic for
reasoning capabilities is covered.

In `@src/api/transform/model-params.ts`:
- Around line 183-190: The TODO about adding a supportsTemperature field is now
outdated—update the comment or remove it: either delete the TODO lines and the
note about OpenRouter's supported_parameters, or change the comment to note that
supportsTemperature is implemented (used by the generic guard above) and that
OpenRouter fetcher already sets it for models like "claude-fable-5"; locate the
block handling modelId === "openai/o1-pro" in model-params.ts and adjust the
comment accordingly so it accurately reflects the current supportsTemperature
handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d1390678-92d0-463e-8a96-d7c6cc6afd7b

📥 Commits

Reviewing files that changed from the base of the PR and between d29520b and b4614ff.

📒 Files selected for processing (22)
  • packages/types/src/providers/anthropic.ts
  • packages/types/src/providers/bedrock.ts
  • packages/types/src/providers/openrouter.ts
  • packages/types/src/providers/vercel-ai-gateway.ts
  • packages/types/src/providers/vertex.ts
  • src/api/providers/__tests__/anthropic-vertex.spec.ts
  • src/api/providers/__tests__/anthropic.spec.ts
  • src/api/providers/__tests__/bedrock.spec.ts
  • src/api/providers/__tests__/requesty.spec.ts
  • src/api/providers/__tests__/vercel-ai-gateway.spec.ts
  • src/api/providers/anthropic.ts
  • src/api/providers/bedrock.ts
  • src/api/providers/fetchers/__tests__/openrouter.spec.ts
  • src/api/providers/fetchers/__tests__/vercel-ai-gateway.spec.ts
  • src/api/providers/fetchers/openrouter.ts
  • src/api/providers/fetchers/requesty.ts
  • src/api/providers/fetchers/vercel-ai-gateway.ts
  • src/api/providers/requesty.ts
  • src/api/providers/vercel-ai-gateway.ts
  • src/api/transform/__tests__/model-params.spec.ts
  • src/api/transform/model-params.ts
  • src/shared/__tests__/api.spec.ts

Comment thread packages/types/src/providers/anthropic.ts
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@JamesRobert20 JamesRobert20 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the Fable 5 registry wiring. A few of the model-info additions don't have the matching allowlist entry, which is where the behavior actually gets gated. Notes inline.

One smaller thing not inline: maxTokens is 8192 on Bedrock/Vertex vs 128k on direct Anthropic. That matches the opus-4-5 pattern in the same files so it's likely intentional, but it does cap long outputs on those paths. Just confirming that's deliberate.

},
],
},
"anthropic.claude-fable-5": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry declares contextWindow 1M, but anthropic.claude-fable-5 isn't in BEDROCK_1M_CONTEXT_MODEL_IDS. Every other Claude model that advertises 1M keeps a 200k base plus a tier that gets unlocked by the context-1m-2025-08-07 beta header, and that header is gated on this list. Fable 5 skips that pattern on all three paths, including direct Anthropic (the beta push in anthropic.ts doesn't list it either). If the model needs the beta header to serve 1M, requests past 200k will fail and the window advertised here is misleading. If Fable 5 serves 1M natively without the header, this is correct as written. Which is it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved. Confirmed from the AWS Bedrock console that Fable 5 can only be used through a cross-region inference profile — so the 1M context window is native and the context-1m-2025-08-07 beta header is not needed (correctly omitted from BEDROCK_1M_CONTEXT_MODEL_IDS). Added anthropic.claude-fable-5 to BEDROCK_GLOBAL_INFERENCE_MODEL_IDS since the inference profile is mandatory for this model.

},
],
},
"claude-fable-5": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as the Bedrock entry: claude-fable-5 declares 1M context but isn't in VERTEX_1M_CONTEXT_MODEL_IDS, so the context-1m-2025-08-07 beta header is never sent on this path. Fine if the model serves 1M without the header, broken if it needs it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved. Confirmed that Fable 5 has a native 1M context window on Vertex AI — it does not require the context-1m-2025-08-07 opt-in beta header. Correctly omitted from VERTEX_1M_CONTEXT_MODEL_IDS; the contextWindow: 1_000_000 in the registry entry is accurate as-is.

"anthropic/claude-opus-4.1",
"anthropic/claude-opus-4.5",
"anthropic/claude-opus-4.6",
"anthropic/claude-fable-5",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fable 5 is in OPEN_ROUTER_PROMPT_CACHING_MODELS but not OPEN_ROUTER_REASONING_BUDGET_MODELS. The fetcher only sets supportsReasoningBudget from that second set, and the fable-5 override block in fetchers/openrouter.ts doesn't set it either, so on OpenRouter the reasoning toggle won't show up even though every other provider path has supportsReasoningBudget: true. The fetcher test only checks maxTokens, contextWindow, and supportsTemperature, so this gap isn't caught.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved. Added anthropic/claude-fable-5 to OPEN_ROUTER_REASONING_BUDGET_MODELS so supportsReasoningBudget is set on the OpenRouter path. Also added supportsReasoningBinary = true to the Fable 5 override block in fetchers/openrouter.ts to match the other provider paths. The OpenRouter fetcher test now asserts both flags.

})

it("returns true when the id carries a cross-region or global prefix", () => {
expect(isAdaptiveThinkingModel("us.anthropic.claude-opus-4-8")).toBe(true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This asserts the global. prefix on Fable 5, but anthropic.claude-fable-5 isn't in BEDROCK_GLOBAL_INFERENCE_MODEL_IDS, so getModel() never produces global.anthropic.claude-fable-5 at runtime (the prefix is only applied for ids in that list). The test passes because isAdaptiveThinkingModel matches on substring, but it covers an id that can't occur in production. If Fable 5 should be reachable through global inference, add it to the list.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved. Added anthropic.claude-fable-5 to BEDROCK_GLOBAL_INFERENCE_MODEL_IDS — confirmed from the AWS Bedrock console that cross-region inference is mandatory for Fable 5 (not optional like the other models in this list). The existing test at this line now covers a real production path, and a new test was added to verify getModel() produces global.anthropic.claude-fable-5 when awsUseGlobalInference: true.

cacheReadsPrice: parseApiPrice(rawModel.cached_price),
}

if (rawModel.id === "anthropic/claude-fable-5") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This override has no direct coverage. The requesty handler tests mock ../fetchers/modelCache with a hardcoded fable-5 entry, so getRequestyModels parsing this branch never runs in the suite. A small test that feeds a raw anthropic/claude-fable-5 model through getRequestyModels and checks these three flags would close that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved. Added src/api/providers/fetchers/__tests__/requesty.spec.ts with direct unit tests for getRequestyModels that exercise the Fable 5 override branch (lines 48–52) without mocking the model cache. Covers both that the three flags are applied for anthropic/claude-fable-5 and that they are not applied to other models.

@JamesRobert20 JamesRobert20 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked the follow-up commit against the earlier review threads. The gaps are closed:

  • OpenRouter: anthropic/claude-fable-5 is in OPEN_ROUTER_REASONING_BUDGET_MODELS, the fetcher override sets supportsReasoningBinary, and the test now asserts both reasoning flags.
  • Bedrock global inference: model is in BEDROCK_GLOBAL_INFERENCE_MODEL_IDS with a test that getModel() emits global.anthropic.claude-fable-5 when the toggle is on.
  • Requesty: new fetchers/__tests__/requesty.spec.ts hits the Fable 5 override branch directly.
  • 1M context on Bedrock/Vertex: omission from the beta-header allowlists is consistent with native 1M, per the thread replies.
  • maxTokens split across provider registries matches the existing opus pattern.

Looks good from here.

@navedmerchant navedmerchant added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit cc26545 Jun 12, 2026
10 checks passed
@navedmerchant navedmerchant deleted the feat/add-fable branch June 12, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants